// Dieser Logger logged auf die Console
var log = log4javascript.getLogger();
var appender = new log4javascript.BrowserConsoleAppender();
var layout = new log4javascript.PatternLayout("%d{HH:mm:ss} %-5p - %m%n");
appender.setLayout(layout);
log.addAppender(appender);

// Dieser Logger logged ins Popup
// Chrome mit "-disable-popup-blocking" starten, wenn popups abgeschaltet sind
//var log = log4javascript.getDefaultLogger();

//// Popup logger mit custom layout
//var log = log4javascript.getLogger();
//var appender = new log4javascript.PopUpAppender();
//var layout = new log4javascript.PatternLayout("%c %d{HH:mm:ss} %-5p - %m%n");
//appender.setLayout(layout);
//log.addAppender(appender);
//log.set("name2");




function odump(object, depth, max){
  depth = depth || 0;
  max = max || 2;

  if (depth > max)
    return false;

  var indent = "";
  for (var i = 0; i < depth; i++)
    indent += "  ";

  var output = "";
  for (var key in object){
    output += "\n" + indent + key + ": ";
    switch (typeof object[key]){
      case "object": output += odump(object[key], depth + 1, max); break;
      case "function": output += "function"; break;
      default: output += object[key]; break;
    }
  }
  return output;
}
